/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Forms;

import Classes.Form137;
import Classes.Grades1;
import Classes.GradesNew;
import Classes.MInterface;
import Classes.Report;
import Classes.User;
import com.itextpdf.text.Document;
import com.itextpdf.text.Image;
import com.itextpdf.text.pdf.PdfWriter;
import java.awt.Component;
import java.awt.Desktop;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.util.ArrayList;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Owner
 */
public class Report_137basicelem extends javax.swing.JFrame {
    private static User u;
    private static MInterface mi;
    private static String idno;
    ArrayList<Object> list = null;
    ArrayList<Object> report = null;
    ArrayList<Object> report1 = null;
    private static BufferedImage img;
    String val = idno;
    String b = "null";
    String b2 = "null"; 
    String b3 = "null";
    String b4 = "null";
    String b5 = "null";
    String b6 = "null";
    String b7 = "null";
    String b8 = "null";
    String b9 = "null";
    String b10 = "null";
    String b11 = "null";
    String b12 = "null";
    String b13 = "null";
    String b14 = "null";
    String b15 = "null";
    String b16 = "null";
    String b17 = "null";
    String b18 = "null";
    String a = "null";
    String a1 = "null";
    String a2 = "null";
    String a3 = "null";
    String a4 = "null";
    String a5 = "null";
    String a6 = "null";
    String a7 = "null";
    String ggrade;
    String gquartername;
    String gsubject;
    DefaultTableModel dtm;
    /**
     * Creates new form Report_137basicelem
     */
    public Report_137basicelem(User user, MInterface i, String idno) {
        u = user;
        mi = i;
        initComponents();
        
        
            try{
//            report = mi.getList1("report", idno);
//            ArrayList<Form137> uu2 = new ArrayList<Form137>();
//            for(int x2 = 0; x2 < report.size(); x2++) {
//            uu2.add((Form137) report.get(x2));
//             a = uu2.get(x2).getStuID();
//             a1 = uu2.get(x2).getsub();
//             a2 = uu2.get(x2).getfirst();
//             a3 = uu2.get(x2).getsecond();
//             a4 = uu2.get(x2).getthird();
//             a5 = uu2.get(x2).getfourth();
//             a6 = uu2.get(x2).getave();
//             a7 = uu2.get(x2).getsy();
//            System.out.println(a);
//            System.out.println(a1);
//            System.out.println(a2);
//            System.out.println(a3);
//            System.out.println(a4);
//            System.out.println(a5);
//            System.out.println(a6);
//            System.out.println(a7);
//            
//            }
            
            report1 = mi.getList4("report1", idno);
            System.out.println(idno);
            ArrayList<Report> uu3 = new ArrayList<Report>();
              for(int x13 = 0; x13 < report1.size(); x13++) {
                  uu3.add((Report) report1.get(x13));
                     
                   b = uu3.get(x13).getidno();
                   b2 = uu3.get(x13).getstuLName();
                   b3 = uu3.get(x13).getstuGName();
                   b4 = uu3.get(x13).getstuMName();
                   b5 = uu3.get(x13).getcAddress();
                   b7 = uu3.get(x13).getbDate();
                   b8 = uu3.get(x13).getbPlace();
                   b9 = uu3.get(x13).getgender();
                   b10 = uu3.get(x13).getcAffiliation();
                   b11 = uu3.get(x13).getcNo();
                   b12 = uu3.get(x13).getfName();
                   b13 = uu3.get(x13).getfOccu();
                   b14 = uu3.get(x13).getfCNo();
                   b15 = uu3.get(x13).getmName();
                   b16 = uu3.get(x13).getmOccu();
                   b17 = uu3.get(x13).getmCNo();
                   b18 = uu3.get(x13).getclassName();
                  System.out.println(b);
                  System.out.println(b2);
                  System.out.println(b3);
                  System.out.println(b4);
                  System.out.println(b5);
                  System.out.println(b6);
                  System.out.println(b7);
                  System.out.println(b8);
                  System.out.println(b9);
                  System.out.println(b10);
                  System.out.println(b11);
                  System.out.println(b12);
                  System.out.println(b13);
                  System.out.println(b14);
                  System.out.println(b15);
                  System.out.println(b16);
                  System.out.println(b17);
                  System.out.println(b18);

              }
              
              
              lNameT4.setText(b2);
              gNameT2.setText(b3);
              mNameT2.setText(b4);
              lNameT5.setText(b5);
              bPlaceT2.setText(b8);
              cAffT2.setText(b10);
              cNoT3.setText(b11);
              faNameT2.setText(b12);
              faOccuT2.setText(b13);
              faCNoT2.setText(b14);
              moNameT44.setText(b15);
              moOccuT2.setText(b16);
              moCNoT2.setText(b17);
              jTextField1.setText(b7);
              jTextField2.setText(b9);
              
              
              
              
              if(b18.equalsIgnoreCase("Kindergarten 1")){
              dtm = new DefaultTableModel(new String[]{jTable15.getColumnName(0), jTable15.getColumnName(1), jTable15.getColumnName(2), jTable15.getColumnName(3), jTable15.getColumnName(4), jTable15.getColumnName(5)}, 0);
              jTable15.setModel(dtm); 
                   
               report = mi.getList4("gradeManage1",idno);
                ArrayList<GradesNew> uu1 = new ArrayList<GradesNew>();
                System.out.println(report.size());
                for (int x11 = 0; x11 < report.size(); x11++) {
                    uu1.add((GradesNew) report.get(x11));
                    ggrade = uu1.get(x11).getgrade();
                    gquartername = uu1.get(x11).getquartername();
                    gsubject = uu1.get(x11).getsubject();
                    System.out.println(ggrade);
                    System.out.println(gquartername);
                    System.out.println(gsubject);
                    
                    dtm.insertRow(x11, new Object[] {gsubject, null, null, null, null, null}); 
                    
                    if(gquartername.equals("First Grading")){    
                  for (int x111 = 0; x111 < uu1.size(); x111++){
                  dtm.setValueAt(ggrade, x111, 1);
            } 
                   }else if(gquartername.equals("Second Grading")){
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    dtm.setValueAt(ggrade, x111, 2);
            }
                   }else if(gquartername.equals("Third Grading")){
                    
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    dtm.setValueAt(ggrade, x111, 3);
            }
                  }else if(gquartername.equals("Fourth Grading")){
                    
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    dtm.setValueAt(ggrade, x111, 4);
            }
                                }
                                }
                      
              }else if(b18.equalsIgnoreCase("Grade 2")){
               dtm = new DefaultTableModel(new String[]{jTable16.getColumnName(0), jTable16.getColumnName(1), jTable16.getColumnName(2), jTable16.getColumnName(3), jTable16.getColumnName(4), jTable16.getColumnName(5)}, 0);
               jTable16.setModel(dtm); 
               report = mi.getList4("gradeManage1",idno);
                ArrayList<GradesNew> uu1 = new ArrayList<GradesNew>();
                for (int x11 = 0; x11 < report.size(); x11++) {
                    uu1.add((GradesNew) report.get(x11));
                    ggrade = uu1.get(x11).getgrade();
                    gquartername = uu1.get(x11).getquartername();
                    gsubject = uu1.get(x11).getsubject();
                    System.out.println(ggrade);
                    System.out.println(gquartername);
                    System.out.println(gsubject);
                    
                    
                    if(gquartername.equals("First Grading")){    
                  for (int x111 = 0; x111 < uu1.size(); x111++) {
                  dtm.setValueAt(ggrade, x11, 1);
              }
                  }else if(gquartername.equals("Second Grading")){
                for (int x111 = 0; x111 < uu1.size(); x111++) {      
                    dtm.setValueAt(ggrade, x11, 2);
                }
                }else if(gquartername.equals("Third Grading")){
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    dtm.setValueAt(ggrade, x11, 3);
                }
                }else if(gquartername.equals("Fourth Grading")){   
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    dtm.setValueAt(ggrade, x11, 4);
                }
                }
                }
              }else if(b18.equalsIgnoreCase("Grade 3")){
               dtm = new DefaultTableModel(new String[]{jTable18.getColumnName(0), jTable18.getColumnName(1), jTable18.getColumnName(2), jTable18.getColumnName(3), jTable18.getColumnName(4), jTable18.getColumnName(5)}, 0);
             jTable18.setModel(dtm); 
               report = mi.getList4("gradeManage1",idno);
                ArrayList<GradesNew> uu1 = new ArrayList<GradesNew>();
                for (int x11 = 0; x11 < report.size(); x11++) {
                    uu1.add((GradesNew) report.get(x11));
                    ggrade = uu1.get(x11).getgrade();
                    gquartername = uu1.get(x11).getquartername();
                    gsubject = uu1.get(x11).getsubject();
                    System.out.println(ggrade);
                    System.out.println(gquartername);
                    System.out.println(gsubject);
                    dtm.insertRow(x11, new Object[] {gsubject, null, null, null, null, null}); 
                    if(gquartername.equals("First Grading")){    
                  for (int x111 = 0; x111 < uu1.size(); x111++) {
                  dtm.setValueAt(ggrade, x11, 1);
                }
                }else if(gquartername.equals("Second Grading")){
                for (int x111 = 0; x111 < uu1.size(); x111++) {
              
                    dtm.setValueAt(ggrade, x11, 2);
                }
                }else if(gquartername.equals("Third Grading")){
                    
                    for (int x111 = 0; x111 < uu1.size(); x111++) {
                    
                    dtm.setValueAt(ggrade, x11, 3);
                }
                }else if(gquartername.equals("Fourth Grading")){
                    
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    
                    dtm.setValueAt(ggrade, x11, 4);
                }
                }
                }
              }else if(b18.equalsIgnoreCase("Grade 4")){
                dtm = new DefaultTableModel(new String[]{jTable17.getColumnName(0), jTable17.getColumnName(1), jTable17.getColumnName(2), jTable17.getColumnName(3), jTable17.getColumnName(4), jTable17.getColumnName(5)}, 0);
             jTable17.setModel(dtm); 
               report = mi.getList4("gradeManage1",idno);
                ArrayList<GradesNew> uu1 = new ArrayList<GradesNew>();
                for (int x11 = 0; x11 < report.size(); x11++) {
                    uu1.add((GradesNew) report.get(x11));
                    ggrade = uu1.get(x11).getgrade();
                    gquartername = uu1.get(x11).getquartername();
                    gsubject = uu1.get(x11).getsubject();
                    System.out.println(ggrade);
                    System.out.println(gquartername);
                    System.out.println(gsubject);
                    dtm.insertRow(x11, new Object[] {gsubject, null, null, null, null, null}); 
                    if(gquartername.equals("First Grading")){    
                  for (int x111 = 0; x111 < uu1.size(); x111++) {
                  dtm.setValueAt(ggrade, x11, 1);
                }
                }else if(gquartername.equals("Second Grading")){
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                
                    dtm.setValueAt(ggrade, x11, 2);
                }
                }else if(gquartername.equals("Third Grading")){
                    
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    
                    dtm.setValueAt(ggrade, x11, 3);
                }
                }else if(gquartername.equals("Fourth Grading")){
                    
                for (int x111 = 0; x111 < uu1.size(); x111++) {
              
                    dtm.setValueAt(ggrade, x11, 4);
                }
                }
                }
              }else if(b18.equalsIgnoreCase("Grade 5")){
                dtm = new DefaultTableModel(new String[]{jTable19.getColumnName(0), jTable19.getColumnName(1), jTable19.getColumnName(2), jTable19.getColumnName(3), jTable19.getColumnName(4), jTable19.getColumnName(5)}, 0);
             jTable19.setModel(dtm); 
               report = mi.getList4("gradeManage1",idno);
                ArrayList<GradesNew> uu1 = new ArrayList<GradesNew>();
                for (int x11 = 0; x11 < report.size(); x11++) {
                    uu1.add((GradesNew) report.get(x11));
                    ggrade = uu1.get(x11).getgrade();
                    gquartername = uu1.get(x11).getquartername();
                    gsubject = uu1.get(x11).getsubject();
                    System.out.println(ggrade);
                    System.out.println(gquartername);
                    System.out.println(gsubject);
                    dtm.insertRow(x11, new Object[] {gsubject, null, null, null, null, null}); 
                    if(gquartername.equals("First Grading")){    
                  for (int x111 = 0; x111 < uu1.size(); x111++) {
                  dtm.setValueAt(ggrade, x11, 1);
                }
                }else if(gquartername.equals("Second Grading")){
                for (int x111 = 0; x111 < uu1.size(); x111++) {
              
                    dtm.setValueAt(ggrade, x11, 2);
                }
                }else if(gquartername.equals("Third Grading")){
                    
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    
                    dtm.setValueAt(ggrade, x11, 3);
                }
                }else if(gquartername.equals("Fourth Grading")){
                    
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    
                    dtm.setValueAt(ggrade, x11, 4);
                }
                }
                }
              }else if(b18.equalsIgnoreCase("Grade 6")){
                 dtm = new DefaultTableModel(new String[]{jTable20.getColumnName(0), jTable20.getColumnName(1), jTable20.getColumnName(2), jTable20.getColumnName(3), jTable20.getColumnName(4), jTable20.getColumnName(5)}, 0);
             jTable20.setModel(dtm); 
               report = mi.getList4("gradeManage1",idno);
                ArrayList<GradesNew> uu1 = new ArrayList<GradesNew>();
                for (int x11 = 0; x11 < report.size(); x11++) {
                    uu1.add((GradesNew) report.get(x11));
                    ggrade = uu1.get(x11).getgrade();
                    gquartername = uu1.get(x11).getquartername();
                    gsubject = uu1.get(x11).getsubject();
                    System.out.println(ggrade);
                    System.out.println(gquartername);
                    System.out.println(gsubject);
                    dtm.insertRow(x11, new Object[] {gsubject, null, null, null, null, null}); 
                    if(gquartername.equals("First Grading")){    
                  for (int x111 = 0; x111 < uu1.size(); x111++) {
                  dtm.setValueAt(ggrade, x11, 1);
                }
                }else if(gquartername.equals("Second Grading")){
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    
                    dtm.setValueAt(ggrade, x11, 2);
                }
                }else if(gquartername.equals("Third Grading")){
                    
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    
                    dtm.setValueAt(ggrade, x11, 3);
                }
                }else if(gquartername.equals("Fourth Grading")){
                    
                for (int x111 = 0; x111 < uu1.size(); x111++) {
                    
                    dtm.setValueAt(ggrade, x11, 4);
                }
                }
                }
              }
              
              // }
               
              
//              if(b18.matches("Grade 1")){
//                  DefaultTableModel dtm = new DefaultTableModel(new String[] {jTable15.getColumnName(0), jTable15.getColumnName(1), jTable15.getColumnName(2), jTable15.getColumnName(3), jTable15.getColumnName(4), jTable15.getColumnName(5)}, 0);
//                  jTable15.setModel(dtm);
//                   for(int x = 0; x < report.size(); x++) {
//                   uu2.add((Form137) report.get(x));
//                       a = uu2.get(x).getStuID();
//             a1 = uu2.get(x).getsub();
//             a2 = uu2.get(x).getfirst();
//             a3 = uu2.get(x).getsecond();
//             a4 = uu2.get(x).getthird();
//             a5 = uu2.get(x).getfourth();
//             a6 = uu2.get(x).getave();
//             a7 = uu2.get(x).getsy();
//                  dtm.insertRow(x, new Object[] {a1,a2,a3,a4,a5,a6});
//            } 
//                   moNameT46.setText(a7);
//              }else if(b18.matches("Grade 2")){
//                  DefaultTableModel dtm1 = new DefaultTableModel(new String[] {jTable16.getColumnName(0), jTable16.getColumnName(1), jTable16.getColumnName(2), jTable16.getColumnName(3), jTable16.getColumnName(4), jTable16.getColumnName(5)}, 0);
//                  jTable16.setModel(dtm1);
//                   for(int x1 = 0; x1 < report.size(); x1++) {
//                       uu2.add((Form137) report.get(x1));
//                       a = uu2.get(x1).getStuID();
//             a1 = uu2.get(x1).getsub();
//             a2 = uu2.get(x1).getfirst();
//             a3 = uu2.get(x1).getsecond();
//             a4 = uu2.get(x1).getthird();
//             a5 = uu2.get(x1).getfourth();
//             a6 = uu2.get(x1).getave();
//             a7 = uu2.get(x1).getsy();
//                  dtm1.insertRow(x1, new Object[] {a1,a2,a3,a4,a5,a6});
//            }
//                   moNameT49.setText(a7);
//              }else if(b18.matches("Grade 3")){
//                   DefaultTableModel dtm2 = new DefaultTableModel(new String[] {jTable18.getColumnName(0), jTable18.getColumnName(1), jTable18.getColumnName(2), jTable18.getColumnName(3), jTable18.getColumnName(4), jTable18.getColumnName(5)}, 0);
//                   jTable18.setModel(dtm2);
//                   for(int x12 = 0; x12 < report.size(); x12++) {
//                       uu2.add((Form137) report.get(x12));
//                       a = uu2.get(x12).getStuID();
//             a1 = uu2.get(x12).getsub();
//             a2 = uu2.get(x12).getfirst();
//             a3 = uu2.get(x12).getsecond();
//             a4 = uu2.get(x12).getthird();
//             a5 = uu2.get(x12).getfourth();
//             a6 = uu2.get(x12).getave();
//             a7 = uu2.get(x12).getsy();
//                   dtm2.insertRow(x12, new Object[] {a1,a2,a3,a4,a5,a6});
//            }
//                   moNameT54.setText(a7);
//              }else if(b18.matches("Grade 4")){
//                    DefaultTableModel dtm3 = new DefaultTableModel(new String[] {jTable17.getColumnName(0), jTable17.getColumnName(1), jTable17.getColumnName(2), jTable17.getColumnName(3), jTable17.getColumnName(4), jTable17.getColumnName(5)}, 0);
//                    jTable17.setModel(dtm3);
//                    for(int x3 = 0; x3 < report.size(); x3++) {
//                        uu2.add((Form137) report.get(x3));
//                       a = uu2.get(x3).getStuID();
//             a1 = uu2.get(x3).getsub();
//             a2 = uu2.get(x3).getfirst();
//             a3 = uu2.get(x3).getsecond();
//             a4 = uu2.get(x3).getthird();
//             a5 = uu2.get(x3).getfourth();
//             a6 = uu2.get(x3).getave();
//             a7 = uu2.get(x3).getsy();
//                    dtm3.insertRow(x3, new Object[] {a1,a2,a3,a4,a5,a6});
//            }
//                    moNameT51.setText(a7);
//              } else if(b18.matches("Grade 5")){
//                    DefaultTableModel dtm4 = new DefaultTableModel(new String[] {jTable19.getColumnName(0), jTable19.getColumnName(1), jTable19.getColumnName(2), jTable19.getColumnName(3), jTable19.getColumnName(4), jTable19.getColumnName(5)}, 0);
//                    jTable19.setModel(dtm4);
//                    for(int x4 = 0; x4 < report.size(); x4++) {
//                   uu2.add((Form137) report.get(x4));
//                       a = uu2.get(x4).getStuID();
//             a1 = uu2.get(x4).getsub();
//             a2 = uu2.get(x4).getfirst();
//             a3 = uu2.get(x4).getsecond();
//             a4 = uu2.get(x4).getthird();
//             a5 = uu2.get(x4).getfourth();
//             a6 = uu2.get(x4).getave();
//             a7 = uu2.get(x4).getsy();     
//                    dtm4.insertRow(x4, new Object[] {a1,a2,a3,a4,a5,a6});
//            }
//                    moNameT58.setText(a7);
//              } else if(b18.matches("Grade 6")){
//                    DefaultTableModel dtm5 = new DefaultTableModel(new String[] {jTable20.getColumnName(0), jTable20.getColumnName(1), jTable20.getColumnName(2), jTable20.getColumnName(3), jTable20.getColumnName(4), jTable20.getColumnName(5)}, 0);
//                    jTable19.setModel(dtm5);
//                    for(int x5 = 0; x5 < report.size(); x5++) {
//                        uu2.add((Form137) report.get(x5));
//                       a = uu2.get(x5).getStuID();
//             a1 = uu2.get(x5).getsub();
//             a2 = uu2.get(x5).getfirst();
//             a3 = uu2.get(x5).getsecond();
//             a4 = uu2.get(x5).getthird();
//             a5 = uu2.get(x5).getfourth();
//             a6 = uu2.get(x5).getave();
//             a7 = uu2.get(x5).getsy();
//                    dtm5.insertRow(x5, new Object[] {a1,a2,a3,a4,a5,a6});
//            }
//                    moNameT57.setText(a7);
//              }
//              
              
              
              
              
              
             
              img = new BufferedImage(panel.getSize().width, panel.getSize().height, BufferedImage.TYPE_INT_RGB);
            panel.paint(img.createGraphics());
        }catch(Exception e){
            
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        print = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jScrollPane2 = new javax.swing.JScrollPane();
        panel = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jScrollPane16 = new javax.swing.JScrollPane();
        jTable15 = new javax.swing.JTable();
        jLabel19 = new javax.swing.JLabel();
        fNameL2 = new javax.swing.JLabel();
        lNameT4 = new javax.swing.JTextField();
        gNameL2 = new javax.swing.JLabel();
        gNameT2 = new javax.swing.JTextField();
        mNameL2 = new javax.swing.JLabel();
        mNameT2 = new javax.swing.JTextField();
        SAddressL2 = new javax.swing.JLabel();
        birthdateL2 = new javax.swing.JLabel();
        birthplaceL2 = new javax.swing.JLabel();
        bPlaceT2 = new javax.swing.JTextField();
        SContactNoL3 = new javax.swing.JLabel();
        cNoT3 = new javax.swing.JTextField();
        cAffT2 = new javax.swing.JTextField();
        cAffiliationL2 = new javax.swing.JLabel();
        faNameT2 = new javax.swing.JTextField();
        faOccuT2 = new javax.swing.JTextField();
        faCNoT2 = new javax.swing.JTextField();
        moCNoT2 = new javax.swing.JTextField();
        faContactNoL4 = new javax.swing.JLabel();
        moOccuT2 = new javax.swing.JTextField();
        moNameT44 = new javax.swing.JTextField();
        moNameL44 = new javax.swing.JLabel();
        faNameL2 = new javax.swing.JLabel();
        genderL2 = new javax.swing.JLabel();
        faContactNoL5 = new javax.swing.JLabel();
        faOccupationL4 = new javax.swing.JLabel();
        faOccupationL5 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        moNameL45 = new javax.swing.JLabel();
        moNameT45 = new javax.swing.JTextField();
        moNameT46 = new javax.swing.JTextField();
        moNameL46 = new javax.swing.JLabel();
        moNameT47 = new javax.swing.JTextField();
        moNameT48 = new javax.swing.JTextField();
        moNameL47 = new javax.swing.JLabel();
        moNameT49 = new javax.swing.JTextField();
        moNameL48 = new javax.swing.JLabel();
        moNameL49 = new javax.swing.JLabel();
        moNameT50 = new javax.swing.JTextField();
        jScrollPane17 = new javax.swing.JScrollPane();
        jTable16 = new javax.swing.JTable();
        jLabel21 = new javax.swing.JLabel();
        lNameT5 = new javax.swing.JTextField();
        moNameL50 = new javax.swing.JLabel();
        jScrollPane18 = new javax.swing.JScrollPane();
        jTable17 = new javax.swing.JTable();
        moNameL51 = new javax.swing.JLabel();
        moNameL52 = new javax.swing.JLabel();
        moNameL53 = new javax.swing.JLabel();
        moNameT51 = new javax.swing.JTextField();
        moNameT52 = new javax.swing.JTextField();
        moNameT53 = new javax.swing.JTextField();
        moNameT54 = new javax.swing.JTextField();
        moNameL54 = new javax.swing.JLabel();
        moNameL55 = new javax.swing.JLabel();
        moNameL56 = new javax.swing.JLabel();
        moNameT55 = new javax.swing.JTextField();
        jScrollPane19 = new javax.swing.JScrollPane();
        jTable18 = new javax.swing.JTable();
        jScrollPane20 = new javax.swing.JScrollPane();
        jTable19 = new javax.swing.JTable();
        moNameL57 = new javax.swing.JLabel();
        moNameL58 = new javax.swing.JLabel();
        moNameT56 = new javax.swing.JTextField();
        moNameL59 = new javax.swing.JLabel();
        moNameT57 = new javax.swing.JTextField();
        moNameL60 = new javax.swing.JLabel();
        moNameL61 = new javax.swing.JLabel();
        moNameL62 = new javax.swing.JLabel();
        jScrollPane21 = new javax.swing.JScrollPane();
        jTable20 = new javax.swing.JTable();
        moNameT58 = new javax.swing.JTextField();
        moNameT59 = new javax.swing.JTextField();
        moNameT60 = new javax.swing.JTextField();
        moNameT61 = new javax.swing.JTextField();
        moNameT62 = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        save = new javax.swing.JButton();

        print.setFont(new java.awt.Font("Tahoma", 1, 12));
        print.setText("Print");
        print.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                printActionPerformed(evt);
            }
        });

        panel.setBackground(new java.awt.Color(255, 255, 255));
        panel.setForeground(new java.awt.Color(255, 255, 255));
        panel.setAutoscrolls(true);
        panel.setDoubleBuffered(false);

        jLabel17.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel17.setText("Binalonan, Pangasinan");

        jLabel18.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabel18.setText("OF BINALONAN, INC");

        jTable15.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "LEARNING AREAS", "     1", "     2", "     3", "     4", "     FR"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane16.setViewportView(jTable15);

        jLabel19.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabel19.setText("ELEMENATRY SCHOOL PERMANENT RECORD");

        fNameL2.setFont(new java.awt.Font("Tahoma", 1, 12));
        fNameL2.setText("Family Name:");

        lNameT4.setFont(new java.awt.Font("Tahoma", 0, 12));
        lNameT4.setDisabledTextColor(java.awt.Color.black);

        gNameL2.setFont(new java.awt.Font("Tahoma", 1, 12));
        gNameL2.setText("Given Name:");

        gNameT2.setFont(new java.awt.Font("Tahoma", 0, 12));
        gNameT2.setDisabledTextColor(java.awt.Color.black);

        mNameL2.setFont(new java.awt.Font("Tahoma", 1, 12));
        mNameL2.setText("Middle Name:");

        mNameT2.setFont(new java.awt.Font("Tahoma", 0, 12));
        mNameT2.setDisabledTextColor(java.awt.Color.black);

        SAddressL2.setFont(new java.awt.Font("Tahoma", 1, 12));
        SAddressL2.setText("Current Address:");

        birthdateL2.setFont(new java.awt.Font("Tahoma", 1, 12));
        birthdateL2.setText("Birthdate:");

        birthplaceL2.setFont(new java.awt.Font("Tahoma", 1, 12));
        birthplaceL2.setText("Birthplace:");

        bPlaceT2.setFont(new java.awt.Font("Tahoma", 0, 12));
        bPlaceT2.setDisabledTextColor(java.awt.Color.black);

        SContactNoL3.setFont(new java.awt.Font("Tahoma", 1, 12));
        SContactNoL3.setText("Contact No:");

        cNoT3.setFont(new java.awt.Font("Tahoma", 0, 12));
        cNoT3.setDisabledTextColor(java.awt.Color.black);

        cAffT2.setFont(new java.awt.Font("Tahoma", 0, 12));
        cAffT2.setDisabledTextColor(java.awt.Color.black);

        cAffiliationL2.setFont(new java.awt.Font("Tahoma", 1, 12));
        cAffiliationL2.setText("Church Affiliation:");

        faNameT2.setFont(new java.awt.Font("Tahoma", 0, 12));
        faNameT2.setDisabledTextColor(java.awt.Color.black);

        faOccuT2.setFont(new java.awt.Font("Tahoma", 0, 12));
        faOccuT2.setDisabledTextColor(java.awt.Color.black);

        faCNoT2.setFont(new java.awt.Font("Tahoma", 0, 12));
        faCNoT2.setDisabledTextColor(java.awt.Color.black);

        moCNoT2.setFont(new java.awt.Font("Tahoma", 0, 12));
        moCNoT2.setDisabledTextColor(new java.awt.Color(0, 0, 0));

        faContactNoL4.setFont(new java.awt.Font("Tahoma", 1, 12));
        faContactNoL4.setText("Contact No:");

        moOccuT2.setFont(new java.awt.Font("Tahoma", 0, 12));
        moOccuT2.setDisabledTextColor(java.awt.Color.black);

        moNameT44.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT44.setDisabledTextColor(java.awt.Color.black);

        moNameL44.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL44.setText("Mother's Maiden Name:");

        faNameL2.setFont(new java.awt.Font("Tahoma", 1, 12));
        faNameL2.setText("Father's Name:");

        genderL2.setFont(new java.awt.Font("Tahoma", 1, 12));
        genderL2.setText("Gender:");

        faContactNoL5.setFont(new java.awt.Font("Tahoma", 1, 12));
        faContactNoL5.setText("Contact No:");

        faOccupationL4.setFont(new java.awt.Font("Tahoma", 1, 12));
        faOccupationL4.setText("Occupation:");

        faOccupationL5.setFont(new java.awt.Font("Tahoma", 1, 12));
        faOccupationL5.setText("Occupation:");

        jLabel20.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel20.setText("ELEMENATARY SCHOOL PROGRESS");

        moNameL45.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL45.setText("Grade 1 - School");

        moNameT45.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT45.setDisabledTextColor(java.awt.Color.black);

        moNameT46.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT46.setDisabledTextColor(java.awt.Color.black);

        moNameL46.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL46.setText("Eligible for Admission to Grade");

        moNameT47.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT47.setDisabledTextColor(java.awt.Color.black);

        moNameT48.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT48.setDisabledTextColor(java.awt.Color.black);

        moNameL47.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL47.setText("Grade 2 - School");

        moNameT49.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT49.setDisabledTextColor(java.awt.Color.black);

        moNameL48.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL48.setText("School Year");

        moNameL49.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL49.setText("Eligible for Admission to Grade");

        moNameT50.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT50.setDisabledTextColor(java.awt.Color.black);

        jTable16.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "LEARNING AREAS", "     1", "     2", "     3", "     4", "     FR"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane17.setViewportView(jTable16);

        jLabel21.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel21.setText("Form 137-E");

        lNameT5.setFont(new java.awt.Font("Tahoma", 0, 12));
        lNameT5.setDisabledTextColor(java.awt.Color.black);

        moNameL50.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL50.setText("School Year");

        jTable17.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "LEARNING AREAS", "     1", "     2", "     3", "     4", "     FR"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane18.setViewportView(jTable17);

        moNameL51.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL51.setText("School Year");

        moNameL52.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL52.setText("Eligible for Admission to Grade");

        moNameL53.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL53.setText("Grade 4 - School");

        moNameT51.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT51.setDisabledTextColor(java.awt.Color.black);

        moNameT52.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT52.setDisabledTextColor(java.awt.Color.black);

        moNameT53.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT53.setDisabledTextColor(java.awt.Color.black);

        moNameT54.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT54.setDisabledTextColor(java.awt.Color.black);

        moNameL54.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL54.setText("Eligible for Admission to Grade");

        moNameL55.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL55.setText("School Year");

        moNameL56.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL56.setText("Grade 3 - School");

        moNameT55.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT55.setDisabledTextColor(java.awt.Color.black);

        jTable18.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "LEARNING AREAS", "     1", "     2", "     3", "     4", "     FR"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane19.setViewportView(jTable18);

        jTable19.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "LEARNING AREAS", "     1", "     2", "     3", "     4", "     FR"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane20.setViewportView(jTable19);

        moNameL57.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL57.setText("School Year");

        moNameL58.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL58.setText("Eligible for Admission to Grade");

        moNameT56.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT56.setDisabledTextColor(java.awt.Color.black);

        moNameL59.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL59.setText("Grade 5 - School");

        moNameT57.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT57.setDisabledTextColor(java.awt.Color.black);

        moNameL60.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL60.setText("Grade 6 - School");

        moNameL61.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL61.setText("Eligible for Admission to Grade");

        moNameL62.setFont(new java.awt.Font("Tahoma", 1, 12));
        moNameL62.setText("School Year");

        jTable20.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "LEARNING AREAS", "     1", "     2", "     3", "     4", "     FR"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane21.setViewportView(jTable20);

        moNameT58.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT58.setDisabledTextColor(java.awt.Color.black);

        moNameT59.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT59.setDisabledTextColor(java.awt.Color.black);

        moNameT60.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT60.setDisabledTextColor(java.awt.Color.black);

        moNameT61.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT61.setDisabledTextColor(java.awt.Color.black);

        moNameT62.setFont(new java.awt.Font("Tahoma", 0, 12));
        moNameT62.setDisabledTextColor(java.awt.Color.black);

        jLabel23.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabel23.setText("MATH EXCELLENCE ACADEMY ");

        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });

        jTextField2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelLayout = new javax.swing.GroupLayout(panel);
        panel.setLayout(panelLayout);
        panelLayout.setHorizontalGroup(
            panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(panelLayout.createSequentialGroup()
                            .addGap(300, 300, 300)
                            .addComponent(jLabel19))
                        .addGroup(panelLayout.createSequentialGroup()
                            .addGap(387, 387, 387)
                            .addComponent(jLabel18))
                        .addGroup(panelLayout.createSequentialGroup()
                            .addGap(2, 2, 2)
                            .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(panelLayout.createSequentialGroup()
                                    .addComponent(SAddressL2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(lNameT5))
                                .addGroup(panelLayout.createSequentialGroup()
                                    .addComponent(fNameL2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(lNameT4, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(gNameL2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(gNameT2, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(mNameL2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(mNameT2))))
                        .addGroup(panelLayout.createSequentialGroup()
                            .addComponent(birthdateL2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(birthplaceL2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(bPlaceT2))
                        .addGroup(panelLayout.createSequentialGroup()
                            .addComponent(genderL2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(20, 20, 20)
                            .addComponent(cAffiliationL2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cAffT2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(SContactNoL3)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cNoT3, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(panelLayout.createSequentialGroup()
                            .addComponent(faNameL2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(faNameT2, javax.swing.GroupLayout.PREFERRED_SIZE, 302, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(faOccupationL4)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(faOccuT2, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(faContactNoL5)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(faCNoT2, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLayout.createSequentialGroup()
                            .addComponent(moNameL44)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(moNameT44, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(faOccupationL5)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(moOccuT2, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(faContactNoL4)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(moCNoT2, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(panelLayout.createSequentialGroup()
                            .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jScrollPane20, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jScrollPane19, javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelLayout.createSequentialGroup()
                                    .addComponent(moNameL55)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT54, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameL54)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT52, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelLayout.createSequentialGroup()
                                    .addComponent(moNameL57)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT58)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameL58)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT60, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(panelLayout.createSequentialGroup()
                                    .addComponent(moNameL59)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT56, javax.swing.GroupLayout.PREFERRED_SIZE, 373, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(18, 18, 18)
                            .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(panelLayout.createSequentialGroup()
                                    .addComponent(moNameL51)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT51, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameL52)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT61, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(panelLayout.createSequentialGroup()
                                    .addComponent(moNameL60)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT59))
                                .addComponent(jScrollPane18, javax.swing.GroupLayout.PREFERRED_SIZE, 473, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jScrollPane21, javax.swing.GroupLayout.PREFERRED_SIZE, 473, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(panelLayout.createSequentialGroup()
                                    .addComponent(moNameL62)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT57, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameL61)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT62, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGroup(panelLayout.createSequentialGroup()
                            .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(panelLayout.createSequentialGroup()
                                    .addComponent(moNameL56)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(moNameT55, javax.swing.GroupLayout.PREFERRED_SIZE, 367, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelLayout.createSequentialGroup()
                                    .addComponent(moNameL45)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT45))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelLayout.createSequentialGroup()
                                    .addComponent(moNameL50)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT46, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameL46)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT47))
                                .addComponent(jScrollPane16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(18, 18, 18)
                            .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelLayout.createSequentialGroup()
                                    .addComponent(moNameL48)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT49, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameL49)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(moNameT50))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelLayout.createSequentialGroup()
                                    .addComponent(moNameL47)
                                    .addGap(10, 10, 10)
                                    .addComponent(moNameT48))
                                .addComponent(jScrollPane17, javax.swing.GroupLayout.PREFERRED_SIZE, 473, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(panelLayout.createSequentialGroup()
                            .addGap(415, 415, 415)
                            .addComponent(jLabel17))
                        .addGroup(panelLayout.createSequentialGroup()
                            .addGap(391, 391, 391)
                            .addComponent(jLabel20))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLayout.createSequentialGroup()
                            .addGap(496, 496, 496)
                            .addComponent(moNameL53)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(moNameT53, javax.swing.GroupLayout.PREFERRED_SIZE, 360, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(panelLayout.createSequentialGroup()
                        .addComponent(jLabel21)
                        .addGap(282, 282, 282)
                        .addComponent(jLabel23)))
                .addGap(0, 14, Short.MAX_VALUE))
        );
        panelLayout.setVerticalGroup(
            panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel23)
                    .addComponent(jLabel21))
                .addGap(7, 7, 7)
                .addComponent(jLabel18)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel17)
                .addGap(18, 18, 18)
                .addComponent(jLabel19)
                .addGap(18, 18, 18)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(fNameL2)
                    .addComponent(lNameT4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(gNameL2)
                    .addComponent(gNameT2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(mNameL2)
                    .addComponent(mNameT2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(SAddressL2)
                    .addComponent(lNameT5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(birthdateL2)
                    .addComponent(birthplaceL2)
                    .addComponent(bPlaceT2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(genderL2)
                    .addComponent(cAffT2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cAffiliationL2)
                    .addComponent(SContactNoL3)
                    .addComponent(cNoT3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(faNameL2)
                    .addComponent(faNameT2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(faOccupationL4)
                    .addComponent(faOccuT2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(faContactNoL5)
                    .addComponent(faCNoT2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(moNameT44, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(moNameL44)
                    .addComponent(faOccupationL5)
                    .addComponent(moOccuT2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(moCNoT2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(faContactNoL4))
                .addGap(25, 25, 25)
                .addComponent(jLabel20)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(panelLayout.createSequentialGroup()
                            .addGap(27, 27, 27)
                            .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(moNameT46, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(moNameL50)
                                .addComponent(moNameT47, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(moNameL46)))
                        .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(moNameT45, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(moNameL45)))
                    .addGroup(panelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(moNameT48, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(moNameL47))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(moNameT49, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(moNameL48)
                            .addComponent(moNameL49)
                            .addComponent(moNameT50, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jScrollPane17, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(moNameT55, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(moNameL56))
                    .addGroup(panelLayout.createSequentialGroup()
                        .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(moNameT53, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(moNameL53))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(moNameT54, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(moNameL55)
                                .addComponent(moNameT52, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(moNameL54))
                            .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(moNameL51)
                                .addComponent(moNameT51, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(moNameL52)
                                .addComponent(moNameT61, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane18, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(jScrollPane19, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelLayout.createSequentialGroup()
                        .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelLayout.createSequentialGroup()
                                .addGap(27, 27, 27)
                                .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(moNameT58, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(moNameL57)
                                    .addComponent(moNameL58)))
                            .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(moNameT56, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(moNameL59)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane20, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelLayout.createSequentialGroup()
                        .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(moNameL60)
                            .addComponent(moNameT59, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(moNameL62)
                            .addComponent(moNameT57, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(moNameL61)
                            .addComponent(moNameT62, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(moNameT60, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane21, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jScrollPane2.setViewportView(panel);

        save.setFont(new java.awt.Font("Tahoma", 1, 12));
        save.setText("Save As PDF");
        save.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 27, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(991, 991, 991))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(save)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(print))))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 1012, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 8, Short.MAX_VALUE))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(print)
                    .addComponent(save))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 719, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void printActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_printActionPerformed
        /*
         * PrinterJob PJ = PrinterJob.getPrinterJob(); //PageFormat PF =
         * PJ.pageDialog(PJ.defaultPage()); PJ.setPrintable((Printable) this);
         * boolean doPrint = PJ.printDialog();
         *
         * //JOptionPane.showMessageDialog(null, doPrint); if(doPrint){ try {
         * PJ.print(); } catch (PrinterException ex) {
         * JOptionPane.showMessageDialog(null, ex.getMessage()); } } JFrame f =
         * new JFrame(); f.getContentPane().add(new JScrollPane(jPanel1));
        f.pack();
         */
        //print(((JScrollPane) panel.getComponents()[0]));
        //jButton1.setVisible(false);
        //printP();
        
        toImg("print");
        Document document = new Document();

        try {
            PdfWriter.getInstance(document, new FileOutputStream("file.pdf"));
            document.open();
            Image image = Image.getInstance("image.png");
            image.scalePercent(51f);
            document.add(image);
            document.close();
            
            File file = new File("file.pdf");
            if (file.toString().endsWith(".pdf")) 
                Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + file);
            else {
                Desktop desktop = Desktop.getDesktop();
                desktop.open(file);
            }
        } catch(Exception e){
            e.printStackTrace();
        }
        
    }//GEN-LAST:event_printActionPerformed

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1ActionPerformed

    private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField2ActionPerformed

    private void saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveActionPerformed
        toPDF();
    }//GEN-LAST:event_saveActionPerformed
    
    public static void print(final Component comp) {
        final float SCALE = .5f;
        PrinterJob job = PrinterJob.getPrinterJob();
        job.setPrintable(new Printable() {
            public int print(Graphics g, PageFormat pf, int page)
                throws PrinterException
            {
                if (page * pf.getImageableHeight() >= SCALE * comp.getHeight())
                    return NO_SUCH_PAGE;
                ((Graphics2D)g).translate(pf.getImageableX(), pf.getImageableY()
                - page * pf.getImageableHeight());
                ((Graphics2D)g).scale(SCALE, SCALE);
                comp.printAll(g);
                return PAGE_EXISTS;
            }
        });
        if (job.printDialog()) {
            try { job.print(); }
            catch (PrinterException ex) {}
        }
    }
    
    public void printP() {// tt
        PrinterJob job = PrinterJob.getPrinterJob();
        job.setJobName("Print Java Component");

        job.setPrintable (new Printable() {    
            public int print(Graphics g, PageFormat pageFormat, int pageIndex) {
                if (pageIndex > 0) {
                    return(NO_SUCH_PAGE);
                } else {
                    Graphics2D g2d = (Graphics2D)g;
                    g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
                    //g2d.scale(Math.min(pageFormat.getImageableWidth()/pane));
                    //JPanel p = panel;
                    //p.setPreferredSize(new java.awt.Dimension(300, 300));
                    //p.setLayout(new javax.swing.BoxLayout(p, BoxLayout.Y_AXIS));
                    //p.setPreferredSize(new java.awt.Dimension(167, 315));
                    panel.printAll(g2d);

                    return(PAGE_EXISTS); 
                }
            }
        });

        if (job.printDialog()) {
            try {
                job.print();
            } catch (PrinterException e) {
                System.err.println(e.getMessage()); 
            }
        }
        //jButton1.setVisible(true);
    }
    
    /*public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {//uu
        if (pageIndex > 0) {
          return(NO_SUCH_PAGE);
        } else {
          Graphics2D g2d = (Graphics2D)g;
          g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
          // Turn off double buffering
          //componentToBePrinted.paint(g2d);
          //frameToPrint.print(g);
          //print(((JScrollPane)jPanel1.getComponents()[0]).getViewport());
          //JFrame f = new JFrame();
            //f.getContentPane().add(new JScrollPane(c));
            //f.pack();
            print(g);
          // Turn double buffering back on
          return(PAGE_EXISTS);
        }
      }*/
    
    public void toImg(String state) {
        if(state.equals("print")) {
            try {
                ImageIO.write(img, "png", new File("image.png"));
            } catch(Exception e) {
                e.printStackTrace();
            }
        } else {
            
        }
    }
    
    public void toPDF() {
        JFileChooser fileChooser = new JFileChooser();
        File fileName =  null;
        if (fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
            boolean doExport = true;
            boolean overrideExistingFile = false;
            fileName = new File(fileChooser.getSelectedFile().getAbsolutePath() + ".pdf");
            while (doExport && fileName.exists() && !overrideExistingFile) {
                overrideExistingFile = (JOptionPane.showConfirmDialog(this, "Replace file?", "File already exists!", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION);
                if (!overrideExistingFile) {    
                    if (fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
                        fileName = new File(fileChooser.getSelectedFile().getAbsolutePath() + ".pdf");
                    } else {
                        doExport = false;
                    }
                }
            }
            if(doExport) {
                Document document = new Document();
                try {
                    PdfWriter.getInstance(document, new FileOutputStream(fileName));
                    document.open();

                    Image image = Image.getInstance("image.png");
                    image.scalePercent(51f);
                    document.add(image);

                    document.close();
                } catch(Exception e){
                    e.printStackTrace();
                }
            }
        }
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Report_137basicelem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Report_137basicelem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Report_137basicelem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Report_137basicelem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Report_137basicelem(u, mi, idno).setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel SAddressL2;
    private javax.swing.JLabel SContactNoL3;
    private javax.swing.JTextField bPlaceT2;
    private javax.swing.JLabel birthdateL2;
    private javax.swing.JLabel birthplaceL2;
    private javax.swing.JTextField cAffT2;
    private javax.swing.JLabel cAffiliationL2;
    private javax.swing.JTextField cNoT3;
    private javax.swing.JLabel fNameL2;
    private javax.swing.JTextField faCNoT2;
    private javax.swing.JLabel faContactNoL4;
    private javax.swing.JLabel faContactNoL5;
    private javax.swing.JLabel faNameL2;
    private javax.swing.JTextField faNameT2;
    private javax.swing.JTextField faOccuT2;
    private javax.swing.JLabel faOccupationL4;
    private javax.swing.JLabel faOccupationL5;
    private javax.swing.JLabel gNameL2;
    private javax.swing.JTextField gNameT2;
    private javax.swing.JLabel genderL2;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane17;
    private javax.swing.JScrollPane jScrollPane18;
    private javax.swing.JScrollPane jScrollPane19;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane20;
    private javax.swing.JScrollPane jScrollPane21;
    private javax.swing.JTable jTable15;
    private javax.swing.JTable jTable16;
    private javax.swing.JTable jTable17;
    private javax.swing.JTable jTable18;
    private javax.swing.JTable jTable19;
    private javax.swing.JTable jTable20;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField lNameT4;
    private javax.swing.JTextField lNameT5;
    private javax.swing.JLabel mNameL2;
    private javax.swing.JTextField mNameT2;
    private javax.swing.JTextField moCNoT2;
    private javax.swing.JLabel moNameL44;
    private javax.swing.JLabel moNameL45;
    private javax.swing.JLabel moNameL46;
    private javax.swing.JLabel moNameL47;
    private javax.swing.JLabel moNameL48;
    private javax.swing.JLabel moNameL49;
    private javax.swing.JLabel moNameL50;
    private javax.swing.JLabel moNameL51;
    private javax.swing.JLabel moNameL52;
    private javax.swing.JLabel moNameL53;
    private javax.swing.JLabel moNameL54;
    private javax.swing.JLabel moNameL55;
    private javax.swing.JLabel moNameL56;
    private javax.swing.JLabel moNameL57;
    private javax.swing.JLabel moNameL58;
    private javax.swing.JLabel moNameL59;
    private javax.swing.JLabel moNameL60;
    private javax.swing.JLabel moNameL61;
    private javax.swing.JLabel moNameL62;
    private javax.swing.JTextField moNameT44;
    private javax.swing.JTextField moNameT45;
    private javax.swing.JTextField moNameT46;
    private javax.swing.JTextField moNameT47;
    private javax.swing.JTextField moNameT48;
    private javax.swing.JTextField moNameT49;
    private javax.swing.JTextField moNameT50;
    private javax.swing.JTextField moNameT51;
    private javax.swing.JTextField moNameT52;
    private javax.swing.JTextField moNameT53;
    private javax.swing.JTextField moNameT54;
    private javax.swing.JTextField moNameT55;
    private javax.swing.JTextField moNameT56;
    private javax.swing.JTextField moNameT57;
    private javax.swing.JTextField moNameT58;
    private javax.swing.JTextField moNameT59;
    private javax.swing.JTextField moNameT60;
    private javax.swing.JTextField moNameT61;
    private javax.swing.JTextField moNameT62;
    private javax.swing.JTextField moOccuT2;
    private javax.swing.JPanel panel;
    private javax.swing.JButton print;
    private javax.swing.JButton save;
    // End of variables declaration//GEN-END:variables
}
